
/*****************************************************************************
 *
 * 作   者: 马婷婷 * 创建时间: 2020/12/15 15:35:46 *
 * Copyright (C) 2008 - 鹏业软件公司
 *
 *****************************************************************************/

import {DataPacket, NorDataList} from 'pengesoft-ng-lib';

/**
 * 奖惩
 */
export class Reward extends DataPacket {
// <<<<<<< HEAD
//   Id: number; // 奖惩id
// =======
  Id: any; // 奖惩id
// >>>>>>> 114a0271d9ae48d67f42c6a79764287a47013b8b
  EmpId: string; // 员工id
  RewardMoney: number; // 奖惩金额
  RewardReason: string; // 奖惩原因
  RewardTime: Date | string; // 奖惩时间

  constructor(options: {
// <<<<<<< HEAD
//     Id?: number;
// =======
    Id?: any;
// >>>>>>> 114a0271d9ae48d67f42c6a79764287a47013b8b
    EmpId?: string;
    RewardMoney?: number;
    RewardReason?: string;
    RewardTime?: Date | string;
  } = {}) {
    super();
    this.Id = !options.Id ? 0 : Number.parseFloat(options.Id.toString());
    this.EmpId = options.EmpId || '';
    this.RewardMoney = !options.RewardMoney ? 0 : Number.parseFloat(options.RewardMoney.toString());
    this.RewardReason = options.RewardReason || '';
    this.RewardTime = this.newDate(options.RewardTime);
  }
}

/**
 * 奖惩列表
 */
export class RewardList extends NorDataList<Reward> {

  constructor(options: {
    _Items?: Array<Reward>
  } = {}) {
    super();
    if (options._Items) {
      for (const item of options._Items) {
        this.append(new Reward(item));
      }
    }
  }
}
